package o;

import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
import o.ewm.n;

public class ekb {
    private int ˋ = 1;
    private String ˏ;

    class a implements cks {
        final /* synthetic */ ekb ˎ;

        private a(ekb o_ekb) {
            this.ˎ = o_ekb;
        }

        public void enableNetworking() {
            eua.ˏ().ˎ("detail_first_translate_time", System.currentTimeMillis());
            this.ˎ.ˋ = 2;
            this.ˎ.ॱ();
        }

        public void upgrade() {
        }

        public void ˋ() {
        }
    }

    public static void ˎ() {
        eua.ˏ().ʼ("detail_first_translate_time");
    }

    public void ॱ(Context context, String str) {
        this.ˏ = str;
        ˋ(context);
    }

    private void ˊ() {
        if ("1".equals(this.ˏ)) {
            this.ˋ = 2;
        } else if ("2".equals(this.ˏ)) {
            this.ˋ = 1;
        }
        ॱ();
    }

    private void ॱ() {
        Intent intent = new Intent();
        intent.setAction(eka.ˋ);
        intent.putExtra("translateFlag", this.ˋ);
        ll.ˏ(ContentManager.getInstant().getContext()).ˋ(intent);
    }

    private boolean ˋ() {
        if (0 == eua.ˏ().ॱ("detail_first_translate_time", 0)) {
            return true;
        }
        return false;
    }

    private void ˎ(Context context) {
        CharSequence string = context.getResources().getString(n.ـʼ);
        cku ˏ = cku.ˏ(context, cku.class, context.getResources().getString(n.ٴˋ), string);
        ˏ.ॱ(-1, context.getResources().getString(n.ٴˊ));
        ˏ.ˎ(-2, 8);
        ˏ.ॱ(new a());
        ˏ.ˎ(context);
    }

    private void ˏ() {
        Toast.makeText(ContentManager.getInstant().getContext(), n.ʹˊ, 0).show();
    }

    private void ˋ(Context context) {
        if (!doo.ˊ(context)) {
            ˏ();
        } else if (ˋ()) {
            ˎ(context);
        } else {
            ˊ();
        }
    }
}
